<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script language="javascript" src="../script/common.js"></script>
<script language="javascript">
	var pageType='dialog';
	function dialog(){}
	dialog.loadAction = function(){
		dialog.setFrameSize(-40);
		Loading.hideFrameLoading();
	}
	dialog.setFrameSize = function(barHeight){
		var h = (document.body.offsetHeight + barHeight) + "px";
		var w = document.body.offsetWidth + "px";
		if(isIE()){
			h = (document.body.clientHeight + barHeight) + "px";
			w = document.body.clientWidth + "px";
		}
		$("dialogframe").style.width = w;
		$("frameTd").style.height = h;
		$("dialogframe").style.height = h;
	}
	dialog.frameLoad = function(){
		if(dialogframe.onClear){
			dialog.addClearBtn();
		}
	}
	dialog.hideBar = function(){
		$("dialogBar").style.display ="none";
		dialog.setFrameSize(40);
	}
	dialog.showBar = function(){
		$("dialogBar").style.display ="";
		dialog.setFrameSize(-40);
	}
	dialog.btnBar = function(str){
		$("dialogBtnBarForm").innerHTML = str;
	}
	dialog.addBtn = function(str){
		var div = $("dialogBtnAdd");
		if (!div) return;
		div.innerHTML = str;
	}
	dialog.addEndBtn = function(str){
		$("dialogEndBtn").innerHTML = str;
	}
	dialog.save = function(){
		if(typeof dialogframe.onSave == 'function'){dialogframe.onSave();}
	}
	dialog.clear = function(){
		if(dialogframe.onClear){
			dialogframe.onClear();
		}else{
			var obj = {name:"",id:""};
			backValue(obj);
		}
	}
	dialog.viewHtml = function(){
		url = dialogframe.location;
		dialogframe.location = "view-source:" + url;
	}
	dialog.dloading = function(){
		$("tDialog").style.display ="block";
		$("tLoading").style.display ="none";
	}
	dialog.btnBar = function(str){
		$("dialogBtnBarForm").innerHTML = str;
	}
	dialog.addClearBtn = function(){
		dialog.addEndBtn("<button type=button name=clear onclick='dialog.clear();' onkeydown=\"if(window.event.keyCode=='13')return false;\">清 空</button>");
	}
	function createButton (btn){
		var b = document.createElement("BUTTON")
		b.innerHTML = btn.value;
		b.name = btn.name;
		b.id = btn.id?btn.id:btn.name;
		b.disabled = btn.disabled;
		if (btn.display == false || btn.display == "none"){
			b.style.display = "none"
		}
		if (typeof btn.actions == "function")
			b.onclick = btn.actions;
		return b;
	}
	function showBtn(buttons){
		$("dialogBtnBarForm").innerHTML = "<div id=btnBarDiv></div>";
		var div = $("btnBarDiv");
		for (var i=0;i<buttons.length;i++){
			div.appendChild(buttons[i]);
		}
	}
	function getDlgBtnDiv(){
		return $("dialogBtnDiv")
	}
	function getSaveBtn(){
		return $("dialogBtnBarForm").confirm
	}
	function backValue(value) {
		window.returnValue = value ;
		window.close();
	}
	document.write("<title>");
	document.write(unesc(getPara("title")));
	for(var i = 0;i<20;i++){
		document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	}
	document.write("</title>");
</script>
</head>
<body bgcolor="#FFFFFF" class="dialogBg" onload="dialog.loadAction()" style="overflow:hidden">
<table width="100%" style="height:100%" border="0" cellpadding="0" cellspacing="0">
<tr id="tDialog" style="display:none"><td height=100% style="height:100%" valign="top">
	<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td id="frameTd" style="height:90%" bgcolor="#FFFFFF">
		<script language="javascript">
			document.write("<iframe name='dialogframe' id='dialogframe' onload='dialog.frameLoad()' marginwidth=0 marginheight=0 frameborder=0 scrolling='auto' style='width:100%;height:100%;'");
			document.write("src='" +unesc(getPara("src"))+ "'></iframe>");
		</script>
		</td>
	</tr>
	<tr id="dialogBar">
		<td height=40 style="border-top:1px solid #aaa" align="center">
		<form id="dialogBtnBarForm" name="dialogBtnBarForm" onsubmit="return false;">
			<div id="dialogBtnDiv">
				<span id="dialogBtnAdd"></span> 
				<span><button type="button" name="confirm" onclick="dialog.save();" onkeydown="if(window.event.keyCode=='13')return false;">确 定</button></span>
				<span><button type="button" name="cancel" onclick="window.close();" onkeydown="if(window.event.keyCode=='13')return false;">取 消</button></span>
				<span id="dialogEndBtn"></span>
			</div>
		</form>
		</td>
	</tr>
	</table>
</td></tr><tr><td id=tLoading class="dialogFrameBg">
	<table height="100%" cellSpacing=0 cellPadding=5 width="100%" border="0" height="100%">
	<tr>
		<td valign=middle align=center>
			
		<div id=tdLoadTitle height=25>&nbsp;</div>
		<div><img src="../images/frame/loading.gif" border="0" align="absmiddle"><B>正在载入，请稍等……</B></div>
		<br><br>
	</tr>
	</table>
</td></tr>

</table>

</body>
</html>
